import { setRem } from '../../shared';
export const Selector = 'sen-button';
export interface ButtonConfig {
  type?: TypeConifg;
  size?: SizeConifg;
  disabled?: string;
  part?: string;
  [key: string | symbol]: any;
}
export enum SizeConifg {
  small = 'small',
  medium = 'medium',
  large = 'large',
}
export enum TypeConifg {
  blue = 'blue',
  green = 'green',
  clear = 'clear',
  purpel = 'purpel',
  deep = 'deep',
  info = 'info',
  warning = 'warning',
  yellow = 'yellow',
  danger = 'danger',
}
// 默认的size样式
export const defualtSize = (size?: SizeConifg) => {
  switch (size) {
    case SizeConifg.small:
      return {
        width: 72,
        height: 24,
        borderRadius: 5,
        fontSize: 12,
        lineHeight: 20,
      };
    case SizeConifg.medium:
      return {
        width: 128,
        height: 44,
        borderRadius: 8,
        fontSize: 16,
        lineHeight: 32,
      };
    case SizeConifg.large:
      return {
        width: 328,
        height: 44,
        borderRadius: 12,
        fontSize: 16,
        lineHeight: 24,
      };
    default:
      return {
        width: 128,
        height: 44,
        borderRadius: 8,
        fontSize: 16,
        lineHeight: 24,
      };
  }
};

export const useDefualtSzie = (size?: SizeConifg) => {
  const sizeStyle = defualtSize(size);
  return setRem(sizeStyle);
};
